import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SmsLogVO, SmsLogForm, SmsLogQuery } from '@/api/sms/log/types';

/**
 * 查询邮件日志列表
 * @param query
 * @returns {*}
 */

export const listSmsLog = (query?: SmsLogQuery): AxiosPromise<SmsLogVO[]> => {
  return request({
    url: '/sms/log/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询邮件日志详细
 * @param id
 */
export const getSmsLog = (id: string | number): AxiosPromise<SmsLogVO> => {
  return request({
    url: '/sms/log/' + id,
    method: 'get'
  });
};

/**
 * 新增邮件日志
 * @param data
 */
export const addSmsLog = (data: SmsLogForm) => {
  return request({
    url: '/sms/log',
    method: 'post',
    data: data
  });
};

/**
 * 修改邮件日志
 * @param data
 */
export const updateSmsLog = (data: SmsLogForm) => {
  return request({
    url: '/sms/log',
    method: 'put',
    data: data
  });
};

/**
 * 删除邮件日志
 * @param id
 */
export const delSmsLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/sms/log/' + id,
    method: 'delete'
  });
};
